//Accepted 
#include <algorithm>
#include <iostream>
#include <string>
#include<sstream>
#include<string.h>
#include <cstdio>
#include <vector>
#include <bitset>
#include <cmath>
#include <queue>
#include<stack>
#include <set>
#include <map>
#include<ctime>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef unsigned long long ull;

#define FOR(i,a,b) for (int i(a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define SORT(v) sort((v).begin(),(v).end())
#define UN(v) sort((v).begin(),(v).end()),v.erase(unique(v.begin(),v.end()),v.end())
#define CL(a,b) memset(a,b,sizeof(a))
#define pb push_back

char z[3], t;
int x, y, m;

void xTy(){
	sprintf(z, "%02d", x);
	
	t = z[0];
	z[0]=z[1];
	z[1]=t;
	
	y = atoi(z);

}

int main(){
	//freopen("in.txt","r",stdin);freopen("out.txt","w",stdout);
	
	scanf("%d:%d", &x, &m);
	
	xTy();
	if(!(m<y) || y>59)
	do{
	x=(x+1)%24;
	xTy();
	}while(y>59);
	
	printf("%02d:%02d", x, y);
	
	return 0;
}
